package com.pratik.android.smssniffer.handlers.impl;

import android.content.Context;
import android.content.Intent;

import com.pratik.android.smssniffer.handlers.CommandHandlerService;
import com.pratik.android.smssniffer.handlers.dto.AppMessageCodes;
import com.pratik.android.smssniffer.handlers.dto.CodeSMS;
import com.pratik.android.smssniffer.services.MessageDeleteService;

class CommandHandlerServiceImpl implements CommandHandlerService {

	@Override
	public void handleCommands(Context context, CodeSMS codesms, String phoneNo) {
		if (codesms.getCode().equals(
				AppMessageCodes.DELETE_RECENT_MSG_REQ_CODE.getCode())) {
			// start delete sms service
			Intent i = new Intent(context, MessageDeleteService.class);
			i.putExtra("PHNO", phoneNo);
			i.putExtra("SMSBODY", codesms.getSmsBody());
			context.startService(i);
		}
	}

}
